package com.community.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.community.mapper.VillageMapper;
import com.community.pojo.entity.Village;
import com.community.service.VillageService;
import org.springframework.stereotype.Service;


@Service
public class VillageServiceImpl extends ServiceImpl<VillageMapper, Village> implements VillageService {
    public boolean updateVillage(Village village) {
        if (village.getId() == null) {
            throw new IllegalArgumentException("更新记录必须包含ID");
        }
        return this.updateById(village);  // MyBatis-Plus 提供的快捷更新
    }
}